package com.edu.user.controller;


import com.edu.entity.HfdVideoInfo;
import com.edu.user.service.IHfdVideoInfoService;
import com.edu.vo.PageResultVO;
import com.edu.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

/**
 * <p>
 * 视频表 前端控制器
 * </p>
 *
 * @author jr
 * @since 2021-04-19
 */
@CrossOrigin
@RestController
@RequestMapping("/manage/video")
public class HfdVideoInfoController {


    @Autowired
    private IHfdVideoInfoService videoInfoService;

    /**
     * 查询视频列表
     *
     * @param currentPage
     * @param pageSize
     * @return
     */
    @ResponseBody
    @RequestMapping("queryListByPage")
    public PageResultVO<HfdVideoInfo> getList(@PathParam("currentPage") Integer currentPage,
                                              @PathParam("pageSize") Integer pageSize,
                                              @PathParam("name") String name) {


        return videoInfoService.getVideoList(currentPage, pageSize, name);
    }

    @ResponseBody
    @RequestMapping("queryVideo")
    public Result queryVideo() {
        return videoInfoService.queryVideo();
    }

    @ResponseBody
    @RequestMapping("bindVideo")
    public Result bindVideo(HfdVideoInfo hfdVideoInfo) {
        return videoInfoService.bindVideo(hfdVideoInfo);
    }

    @ResponseBody
    @RequestMapping("uploadVideo")
    public Result uploadVideo(HfdVideoInfo hfdVideoInfo) {
        return videoInfoService.uploadVideo(hfdVideoInfo);
    }


}
